STEP 5: On the moon, things only weigh 16% of what what they weigh on earth!

To get 16% of a number: Move the decimal to the left 2 places to get 0.16. Then multiply 0.16 by the number.

  • Change the name of the float variable inside the function from my_var to moon_weight.
  • Change the variable's value from 2.34 to earth_weight * 0.16.
  • The resulting code should look like this! moon_weight = earth_weight * 0.16

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)